package org.lq.ssm.util;

import org.lq.ssm.mapper.JobPOMapper;
import org.lq.ssm.mapper.RolePOMapper;
import org.lq.ssm.po.RolePOExample;
import org.lq.ssm.po.UsersRolesExample;
import org.lq.ssm.po.UsersRolesKey;

import java.util.LinkedList;
import java.util.List;

public class POFactory {


    public static void getPO(Object mapper){
        if (mapper.getClass()== JobPOMapper.class) {System.out.println(mapper.getClass()+"as");}
        else {System.out.println(mapper.getClass());}
//        UsersRolesExample usersRolesExample = new UsersRolesExample();
//        UsersRolesExample.Criteria criteria = usersRolesExample.createCriteria();
//        criteria.andUserIdEqualTo(userDTO.getId());
//        List<UsersRolesKey> usersRolesKeys = usersRolesMapper.selectByExample(usersRolesExample);
//        List<Long> rolesKeys = new LinkedList<>();
//        for (UsersRolesKey usersRolesKey : usersRolesKeys){
//            rolesKeys.add(usersRolesKey.getRoleId());
//        }
//        RolePOExample rolePOExample = new RolePOExample();
//        RolePOExample.Criteria criteria1 = rolePOExample.createCriteria();
//        criteria1.andIdIn(rolesKeys);
//        userDTO.setRole(rolePOMapper.selectByExample(rolePOExample));
    }
}
